var QuotaRecords = function () {
	
	var options;

    var handle = function () {

    	var grid = new Datatable();
    	
        grid.init({
            src: $("#datatable_quotarecords"),
            fixedColumns: 1,
            onSuccess: function (data) {
            	
            },
            onError: function (data) {
               
            },
            dataTable: {
                "pageLength": 10,
                "ajax": {
                    "url": options.ctx + '/quotarecord/list'
                },
                "columnDefs": [{'orderable': false, 'targets': [0,4,5]}],
                "columns": [
                            {"render": function(data,type,full) {
								return '<div class="btn-group"></div>';
							}},
                            {"data": "userName"},
                            {"data": "type", "render": function(data,type,full) {
								return message['net.lanelife.casino.caipiao.entity.QuotaRecord.Type.' + data];
							}},
							{"data": "beginRebatePoint", "render": function(data,type,full) {
								return full.beginRebatePoint + ' - ' + full.endRebatePoint;
							}},
							{"data": "quota", "render": function(data,type,full) {
								return full.direction == 'IN' ? '+' + data : '';
							}},
							{"data": "quota", "render": function(data,type,full) {
								return full.direction == 'OUT' ? '-' + data : '';
							}},
							{"data": "childName"},
							{"data": "createdDate"}
                        ],
                "order": [
                    [7, "desc"]
                ]
            }
        });
        
    };

    return {
        init: function (opts) {
			
			options = $.extend(true, {}, opts);
			
            handle();
			
        }
    };

}();

